import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import OrderView from '@/views/OrderView.vue'
import MyView from '@/views/MyView.vue'
import ShopCar from '@/views/ShopCar.vue'
import CateDetail from '@/views/CateDetail.vue'
import EvaluateView from '@/views/EvaluateView.vue'
import CateView from '@/views/CateView.vue'
import Classify from '@/views/Classify.vue'
import LoginView from '@/views/LoginView.vue'
import RegisterView from '@/views/RegisterView.vue'
import Evaluate from '@/views/Evaluate.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/order',
    component: HomeView,
    children: [
      {
        path: 'order',
        name: 'order',
        component: OrderView,
      },
      {
        path: 'my',
        name: 'my',
        component: MyView,
      },
      {
        path: 'shopCar',
        name: 'shopCar',
        component: ShopCar,
      },
      {
        path: 'login',
        name: 'login',
        component: LoginView,
      },
      {
        path: 'register',
        name: 'register',
        component: RegisterView,
      },
    ]
  },
  {
    path: '/CateDetail',
    name: 'CateDetail',
    redirect: '/CateDetail/cate',
    component: CateDetail,
    children: [
      {
        path: 'evaluate',
        name: 'evaluate',
        component: EvaluateView,
      },
      {
        path: 'cate',
        name: 'cate',
        component: CateView,
      }
    ]
  },
  {
    path: '/classify',
    name: 'classify',
    component: Classify,
  },
  {
    path: '/evaluate',
    name: 'evaluate_',
    component: Evaluate,
  },

]

const router = new VueRouter({
  routes
})

export default router
